| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | 'use strict'; |
||
| 5 | .service('state', [function() { |
||
| 6 | this.currentElement = 'H'; |
||
| 7 | this.hoverElement = ''; |
||
| 8 | this.export = ''; |
||
| 9 | this.player = {}; |
||
| 10 | this.loading = true; |
||
| 11 | let updateFunctions = []; |
||
| 12 | |||
| 13 | this.init = function() { |
||
| 14 | this.currentElement = 'H'; |
||
| 15 | this.hoverElement = ''; |
||
| 16 | this.export = ''; |
||
| 17 | }; |
||
| 18 | |||
| 19 | this.registerUpdate = function(func){ |
||
| 20 | updateFunctions.push(func); |
||
| 21 | }; |
||
| 22 | |||
| 23 | this.update = function(player){ |
||
| 24 | for(let func of updateFunctions){ |
||
| 25 | func(player); |
||
| 26 | } |
||
| 27 | }; |
||
| 28 | }]); |
||
| 29 |